/**************************************************************************************** Import */
import React, {Component} from 'react';
import CHeader from '../../system/page/header';
import CBetween from '../../system/contain/between';
import CHand from '../../system/contain/hand';
import CIcon from '../../system/element/icon';
import CText from '../../system/element/text';
import Design from '../../../../design';

/**************************************************************************************** Component */
export default class PHeader extends Component {

    /**
     * 渲染
     */
    render() {
        if (!this.props.right) {
            return (
                <CHeader h='96' y='center' bg='#fff'>
                    <CBetween px='20'>
                        <CHand onPress={(e)=> {
                            this.props.nav.goBack()
                        }}>
                            <CIcon icon={Design.icon.gobcak} color='#ccc' w='44' h='44'></CIcon>
                        </CHand>
                        <CText size='34'>{this.props.children}</CText>
                        <CHand w='44' h='44'></CHand>
                    </CBetween>
                </CHeader>
            );
        }
        return (
            <CHeader h='96' y='center' bg='#fff'>
                <CBetween px='20'>
                    <CHand onPress={(e)=> {
                        this.props.nav.goBack()
                    }}>
                        <CIcon icon={Design.icon.gobcak} color='#ccc' w='44' h='44'></CIcon>
                    </CHand>
                    <CText size='34'>{this.props.children}</CText>
                    {this.props.right}
                </CBetween>
            </CHeader>
        );		
	}
}
